<template>
  <el-pagination
    id="pagination"
    @size-change="handleSizeChange"
    @current-change="handleCurrentChange"
    :current-page="currentPage"
    :page-sizes="pageSizes"
    :page-size="pageSize"
    :layout="layout"
    :total="total"
  >
  </el-pagination>
</template>

<script>
export default {
  props: {
    currentPage: {
      type: Number,
      default: 0
    },
    pageSizes: {
      type: Array,
      default: () => [10, 20, 30, 40]
    },
    pageSize: {
      type: Number,
      default: 20
    },
    layout: {
      type: String,
      default: 'total, prev, pager, next, jumper'
    },
    total: {
      type: Number,
      default: 0
    }
  },
  methods: {
    handleSizeChange() {
      this.$emit('handleSizeChange')
    },
    handleCurrentChange() {
      this.$emit('handleCurrentChange')
    }
  }
}
</script>

<style lang="scss" scoped>
#pagination {
  float: right;
  margin: 20px;
}
</style>
